Many page de-skew algorithms depend on finding the edge of the document against the backing of the scanner. This method has some limitations. First, it does not work very well where the input media contains image all the way to the edge (e.g., photographs). Second, it does not work very well when the media itself is dark (e.g., dark-colored paper).
Image processing algorithms exist for determining the skew and registration of a scanned input image. Some of these systems use image skew detection. The image content is used to determine the skew of the input document. Simpler algorithms employ page or media skew detection, wherein the paper (or other media) edge is detected and used to determine the skew and media corners.
From an image processing perspective, an attribute of the paper is used to distinguish the paper from the backing of the scanner. The attribute used is the gray value of the paper. This is convenient in systems where the backing of the scanner is black, and thus easily distinguished. In such a system, a black-to-white transition in the captured image corresponds to the backing-to-paper transition, i.e., the paper edge.
This method works fine for images where the paper is white and there is no image near the border. Problems arise, however, when the paper is either colored or when the image goes up the border such as, for example, in a photograph.